#include "soundwidget.h"
#include<QVBoxLayout>
#include<QEvent>
SoundWidget::SoundWidget(QWidget *parent)
{
    this->setFixedSize(40,150);

    this->setWindowFlag(Qt::Window);
    this->setWindowFlag(Qt::FramelessWindowHint);   //无上方标题栏

    slider=new QSlider(this);
    QVBoxLayout* lay=new QVBoxLayout(this);
    lay->addWidget(slider);
    lay->setAlignment(Qt::AlignCenter);


    slider->setRange(0,100);
    slider->setOrientation(Qt::Vertical);      //设置成垂直方向
    slider->setTickPosition(QSlider::NoTicks); //设置为无刻度

    this->setStyleSheet(R"(
        soundWidget{
            background-color:white;
            border-radius:10px;
        }
    )");
}

void SoundWidget::leaveEvent(QEvent *event)
{
    this->hide();
    QWidget::leaveEvent(event);
    event->accept();
}
